#!/bin/sh
. scripts/functions
scripts/cleanup
scripts/copy-2disk-confs
scripts/prepare-disk-changer
echo "Unload drive 0"
$scripts/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0
echo "rtn=$?"
echo "Test what is in drive 0"
$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive0 0
echo "rtn=$?"
echo "Load Slot 1 into drive 0"
$scripts/disk-changer tmp/disk-changer/conf load 1 tmp/disk-changer/drive0 0
echo "rtn=$?"
echo "Test what is in drive 0"
$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive0 0
echo "rtn=$?"

echo "Unload drive 1"
$scripts/disk-changer tmp/disk-changer/conf unload 2 tmp/disk-changer/drive1 1
echo "rtn=$?"
echo "Test what is in drive 1"
$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive1 1
echo "rtn=$?"
echo "Load Slot 2 drive 1"
$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive1 1
echo "rtn=$?"
echo "Test what is in drive 1"
$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive1 1
echo "rtn=$?"

echo "Load Slot 1 into drive 0 -- error"
$scripts/disk-changer tmp/disk-changer/conf load 1 tmp/disk-changer/drive0 0
echo "rtn=$?"
echo "Load Slot 2 into drive 1 -- error"
$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive1 1
echo "rtn=$?"
echo "Load Slot 2 in drive 0 -- error"
$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive0 0
echo "rtn=$?"
echo "Unload drive 0"
$scripts/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0
echo "rtn=$?"
echo "Load Slot 2 in drive 0 -- should fail"
$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive0 0
echo "rtn=$?"
